﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using Framework.Data.Exceptions;
//
//Description : Interface qui représente un entité de base
//Auteur : Marc-Eric Boisvert
//Date Création : 31 mars 2008
//Révisions:
//

namespace Framework.Data.Core
{
    public interface IBaseEntity : IEditableEntity, IReadOnly
    {
        bool IsNew { get; set; }
        Dictionary<string, IField> Fields { get; }
        object HashCode { get; }
        Dictionary<string, ChildrenContainer> ChildrenContainers { get; }
        Dictionary<string, AttachedContainer> AttachedContainers { get; }
        IField GetField(string fieldName);
        IField GetPrimaryKeyField();
        string GetDefaultSortOrder();
        IBaseEntity Duplicate(bool duplicateChildren, IDbConnection connection = null);
        List<AppException> ValidateRules();
        bool CanDelete(ref AppException deleteException);
        void AddField(string key, IField field);
        void InitializeData(IDataReader dataReader);
        void InitializeData(System.Data.DataColumnCollection dataColumns, DataRow dataRow);
        System.Type GetType();
        string ToString();


    }
}